



<!DOCTYPE html>
<html>
  <head>
    <title>
      validate验证框架演示
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Page-Enter" content="revealTrans(duration=1, transition=2)" />
    <meta http-equiv="Page-Exit" content="revealTrans(duration=1, transition=2)" />

	<link type="text/css" rel="stylesheet" href="../Styles/SyntaxHighlighter.css" />
	<link type="text/css" rel="stylesheet" href="./demo.css" />
	<script src="../Scripts/shCore.js" type="text/javascript"></script>
	<script src="../Scripts/shBrushJScript.js" type="text/javascript"></script>
	<script src="../Scripts/shBrushJava.js" type="text/javascript"></script>


    <link type="text/css" rel="stylesheet" href="../js/validate/css/validate.css" />
    <script src="./jquery-1.6.4.js" language="javascript">
    </script>
    <script src="../js/validate/talent-validate-all.js" language="javascript">
    </script>
    <script src="./demo.js" language="javascript">
    </script>
  </head>
  <body>
    <form name="form1">
      字段1
      <input type="text" value="dd" name="n1" />
      <br />
      字段2
      <select type="text" value="3" name="n2" id='n2' width='140px'>
        <option value=''>
        </option>
        <option value='210012'>
          210012
        </option>
        <option value='dsdf'>
          dsdf
        </option>
      </select>
      <br />
      <br />
      <input type="button" class='button' value="验证" onclick="tt.validate()" />
      <input type="button" class='button' value="取消验证" onclick="myCancel();" />
      <!-- 所有验证器都有remove()函数 -->
      <input type="button" class='button' value="添加验证" onclick="myAdd()" />

    </form>
  </body>
  <script id="talent_script">
    var f1 = new tt.Field("","n1").add(tt.vf.postcode, tt.vf.req);
    var f2 = new tt.Field("","n2").add(tt.vf.postcode, tt.vf.req);

    function myCancel() {
      f1.rm(tt.vf.postcode, tt.vf.req);  //取消指定的验证器
      f2.rmAll();                        //取消所有的验证器
    }
    function myAdd(){
      f1.add(tt.vf.postcode, tt.vf.req);
      f2.add(tt.vf.postcode, tt.vf.req);
    }
  </script>
</html>
